home *** CD-ROM | disk | FTP | other *** search
/ SGI Enlighten DSM 1.1 / SGI EnlightenDSM 1.1.iso / aix41 / events.z / events / policy / mbox2big.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1998-06-30  |  1KB  |  39 lines

  1. #!/bin/sh
  2. #
  3. #  Copyright (c) 1990-1998 Enlighten Software Solutions, Inc.
  4. #
  5. #  Example of automatically notifing users when their mailbox is too big
  6. #  Create a new test using one of the "api" groups:
  7. #    1. edit crontab and have this run daily: 
  8. #          ls -l /usr/spool/mail | grep -v total > /mailboxes
  9. #    2. configure one of AgentMon's 'api' groups:
  10. #         Testname: api1  (or any other valid api group name)
  11. #         data=5          (mailbox sizes. May be in differant field on your OS)
  12. #         lable=9         (or whatever field the box owner's name is in)
  13. #         testfreq=1440   (check daily, i.e. every 1440 minutes)
  14. #         notify=$ENLIGHTEN/agent/policy/mbox2big
  15. #
  16. #  DISCLAIMER :
  17. #     THIS PROGRAM IS ONLY AN EXAMPLE. IT IS UNSUPPORTED AND NOT INTENDED
  18. #     FOR ACTUAL USE.  IF YOU DECIDE YOU MAY WANT TO EXECUTE THIS PROGRAM,
  19. #     YOU ARE STRONGLY URGED TO FIRST VERIFY IT'S SUITABLITY AND BEHAVIOR. 
  20. #     
  21. # TESTNAME=$1
  22. # VALUE=$2
  23. # UNITS=$3
  24. # ALARM=$4
  25. # TIME=$5
  26. NAME=$UNITS
  27. mail $NAME << 'WARNING_EOF' > ck &&
  28.  
  29.    The system has noticed that your mailbox has become rather large.
  30.    Please delete any old messages so we can reclain the disk space.
  31.    This is an automated message sent on behalf of your systems administrator
  32.    (who has also been notified).
  33.  
  34. WARNING_EOF
  35. #
  36. echo $NAME 'was warned  on '`date` >> /usr/adm/bigmboxes
  37. #
  38. # DONE
  39.